Minor code cleanups.
authorRobert Lipe <robertlipe@gpsbabel.org>
Thu, 7 Dec 2017 06:31:07 +0000 (00:31 -0600)
committerRobert Lipe <robertlipe@gpsbabel.org>
Thu, 7 Dec 2017 06:31:07 +0000 (00:31 -0600)
an1.cc
garmin_txt.cc
shape.cc

diff --git a/an1.cc b/an1.cc
index 9515489219776fd7295aa653a8bef8aeb5de53e7..a5b5b68cdc6c5007e3a9981cccf279073fe8ead9 100644 (file)
--- a/an1.cc
+++ b/an1.cc
@@ -446,8 +446,6 @@ static void Read_AN1_Waypoint(gbfile* f, an1_waypoint_record* wpt)
 
 static void Write_AN1_Waypoint(gbfile* f, an1_waypoint_record* wpt)
 {
-  short len;
-
   WriteShort(f, wpt->magic);
   WriteLong(f, wpt->unk1);
   WriteLong(f, wpt->lon);
@@ -464,7 +462,7 @@ static void Write_AN1_Waypoint(gbfile* f, an1_waypoint_record* wpt)
   WriteShort(f, wpt->unk5);
   WriteDouble(f, wpt->radius);
 
-  len = strlen(wpt->name) + 1 + 2 + 2 +
+  short len = strlen(wpt->name) + 1 + 2 + 2 +
         (wpt->url ? strlen(wpt->url) : 0) + 2 +
         (wpt->comment ? strlen(wpt->comment) : 0) + 8 + 8;
   WriteShort(f, len);
index ee62e9dcd8cb90d570f225350bf972dd88208006..e5781fc3bb5644cb034a350e89d8fa88a7fab0f8 100644 (file)
@@ -62,7 +62,7 @@ static time_t utc_offs = 0;
 // Having a Windows background, this software encodes degree marks in
 // Windows CP-1252.  We don't attempt to handle all the subtleties of that,
 // but since we write degree marks and we know how they're encoded, use this.
-static const char kDegreeSymbol = 0xB0;
+static const unsigned char kDegreeSymbol = 0xB0;
 
 static gtxt_flags_t gtxt_flags;
 
index 32282b96e0d6327407908b440dc200ffdbd028d5..f1155fc5eac516a0662baa5570e982ca9eeb3cb2 100644 (file)
--- a/shape.cc
+++ b/shape.cc
@@ -316,9 +316,9 @@ my_write_wpt(const Waypoint* wpt)
   // We could potentially write SHPT_POINTZ, but we would have
   // to address what to do when we don't have altitude data.
   shpobject = SHPCreateSimpleObject(SHPT_POINT, 1,
-                                    (double*)(void*)&wpt->longitude,
-                                    (double*)(void*)&wpt->latitude,
-                                    (double*)(void*)&wpt->altitude);
+                                    &wpt->longitude,
+                                    &wpt->latitude,
+                                    &wpt->altitude);
   int iShape = SHPWriteObject(ohandle, -1, shpobject);
   SHPDestroyObject(shpobject);
   DBFWriteStringAttribute(ohandledb, iShape, nameFieldIdx,